import axios from "axios";
import React, { use, useDebugValue, useId, useState, useSyncExternalStore } from "react";
import './index.scss'

import { useTitle, useProList } from './hooks'

function App() {

    const [title, setTitle] = useState('我的标题')

    // 使用自定义 hooks
    useTitle(title)

    const proList = useProList(5)


    return <div>
        <h1>App</h1>
        <button onClick={() => {
            setTitle('锄禾日当午')
        }}>点击修改标题</button>

        {proList.length && proList.map(item => {
            return <p key={item.proid}>{item.proname}</p>
        })}
    </div>
}


export default App